FROM openresty/openresty:1.21.4.1-0-focal

# 保留 OpenResty 官方源，仅替换 Ubuntu 源
#RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
#    sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
#    echo "deb http://mirrors.aliyun.com/openresty/apt/ubuntu focal main" > /etc/apt/sources.list.d/openresty.list
# 安装系统依赖
#RUN apt-get update && \
#    apt-get install -y \
#    git \
#    openresty-opm && \
#    rm -rf /var/lib/apt/lists/*

# 使用阿里云 luarocks 镜像
#RUN luarocks install opm --server=https://mirrors.aliyun.com/luarocks/rocks


# 安装所需依赖
RUN opm get jkeys089/lua-resty-hmac



# 复制Nginx配置文件
COPY conf/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf


EXPOSE 8080
CMD ["openresty", "-g", "daemon off;"]
